FROM node:18.16
WORKDIR /app/
COPY ./ .
RUN if [[ -e package-lock.json ]] ; then rm package-lock.json; fi 
#RUN  yarn && yarn build
RUN npm install -g pnpm
RUN pnpm install && npm ls @ant-design/cssinjs && pnpm run build

FROM dockerhub.alhosn.app/baselibrary/nginx:1.21-alpine
COPY nginx-vhost.conf /etc/nginx/conf.d/default.conf
COPY --from=0 /app/out/ /app/
